package collection;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class VectorDemo {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("a");
        list.add("b");
        list.add("c");
        Iterator<String> it = list.iterator();
        /////////////////////
        it.next();
        it.next();
        it.remove();
        ////////////////////
        while(it.hasNext()){
            String str = it.next();
            System.out.println(str);
        }
        it = list.iterator();
        System.out.println("-----------");
        while(it.hasNext()){
            String str = it.next();
            System.out.println(str);
        }
        System.out.println("-----------");
        for(Iterator<String> it1 = list.iterator();it1.hasNext(); ){
            String str = it1.next();
            System.out.println(str);
        }
    }
}
